package com.wn.controller;


import com.wn.entity.Article;
import com.wn.service.ArticleService;
import com.wn.util.ResultVO;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author Gapper
 * @since 2023-02-15
 */
@RestController
@RequestMapping("/article")
public class ArticleController {
    @Resource
    private ArticleService articleService;

    @PostMapping("{aid}")
    public ResultVO getOneArticle(@PathVariable Integer aid){
        Article article = articleService.getById(aid);
        return ResultVO.success("ok",article);
    }

}

